//Creating Linked List
  public class Node{
    Node next = null;    //Changing the claim, put null right in the declaration part.
    int data;
    
    public Node(int data){
    this.data = data;
    }
    
    public void appendToTail(int d){
      Node tail = new Node(d);
      Node current = this;
      while(current.next != null)
        current = current.next;
      current.next = tail;
    }
  }
  
  //Deleting node from singly Linked List.
  Node deleteNode(Node head, int d) {
    Node n = head;
    
    if(n.data == d)
      return n.next; //if it's null, then return null.
    
    while(n.next != null){
      if(n.next.data == d){
        n.next = n.next.next;
        return head;
      }
      n = n.next; //This part is esential;
    }
    
    return head;
    }
    
    
    
    
    
    
    